<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Multiple redirects</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<iframe src=""></iframe>
<script>
async_test(function(t) {
  var iframe = document.getElementsByTagName("iframe")[0];
  var base_url = "/common/redirect.py?location=/common/dummy.xhtml";
  var second = "/common/redirect.py?location=" + base_url;
  var third = "/common/redirect.py?location=" + second;
  iframe.src = third;
  iframe.onload = t.step_func(function() {
    if(iframe.contentWindow.location.href === new URL('/common/dummy.xhtml', location.href).href) {
        this.done();
    }
  });
});
</script>
</body>
</html>
